package com.jianjun.framework.security.service;

import com.jfinal.plugin.ehcache.UtilCache;
import com.jianjun.common.constant.CacheConstants;


/**
 * 登录密码方法
 *
 * @author source
 */
public class SysPasswordService {

    /**
     * 登录账户密码错误次数缓存键名
     *
     * @param username 用户名
     * @return 缓存键key
     */
    private String getCacheKey(String username) {
        return CacheConstants.PWD_ERR_CNT_KEY + username;
    }


    public void clearLoginRecordCache(String loginName) {
        if (UtilCache.exists(getCacheKey(loginName))) {
            UtilCache.del(getCacheKey(loginName));
        }
    }
}
